﻿<Window x:Class="DTC.Popups.VisitsHistoryPopup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Converters="clr-namespace:DTC.Converters"
    Title="История посещений" Style="{StaticResource PopupWindow}" Height="600" Width="600">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/ListBoxStyles.xaml"/>
                <ResourceDictionary Source="../Resources/ButtonsStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid Name="MainGrid" Margin="20">
        <ListBox Name="VisitsListBox"
                 ItemContainerStyle="{StaticResource ColorListBoxItem}"
                 HorizontalContentAlignment="Stretch"
				 SnapsToDevicePixels="True">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="0" SnapsToDevicePixels="True"
									MinHeight="80">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.2*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.5*"/>
                            <RowDefinition Height="0.5*"/>
                        </Grid.RowDefinitions>
                        <Border BorderBrush="#FFCAD1FF" 
									BorderThickness="1" CornerRadius="3"
									Grid.Column="0"  Grid.RowSpan="2"
									Margin="4,4,2,4">
                            <StackPanel VerticalAlignment="Center"
                                            HorizontalAlignment="Center">
                                <TextBlock Text="Дата:"
											Foreground="Gray"
											FontSize="10"
                                            Margin="5,0,5,0"
											HorizontalAlignment="Center"
											VerticalAlignment="Center"/>
                            	<TextBlock HorizontalAlignment="Center"
											VerticalAlignment="Center"
                                           Margin="5,0,5,0"
											FontSize="14">
                                    <TextBlock.Text>
	                                        <Binding Path="DateFrom">
    	                                        <Binding.Converter>
        	                                        <Converters:DateTimeToDateConverter></Converters:DateTimeToDateConverter>
            	                                </Binding.Converter>
                	                        </Binding>
                    	                </TextBlock.Text>
                                    </TextBlock>
                             </StackPanel>
                        </Border>
                        <Border BorderBrush="#FFCAD1FF" 
                                BorderThickness="1" CornerRadius="3"
                                Grid.Column="1"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Margin="2,4,4,2">
                            <WrapPanel VerticalAlignment="Center"
                                            HorizontalAlignment="Center">
                                <TextBlock Text="Врач:"
											Foreground="Gray"
											FontSize="10"
											HorizontalAlignment="Center"
                                            Margin="5,0,5,0"
											VerticalAlignment="Center"/>
                            	<TextBlock Text="{Binding DTCDoctor.FullName}"
											HorizontalAlignment="Center"
                                            Margin="5,0,5,0"
											VerticalAlignment="Center"/>
                             </WrapPanel>
                        </Border>
                        <Border BorderBrush="#FFCAD1FF" 
                                BorderThickness="1" CornerRadius="3"
                                Grid.Column="1"  Grid.Row="1"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Margin="2,2,4,4">
                            <StackPanel VerticalAlignment="Top"
                                            HorizontalAlignment="Center">
                                <TextBlock Text="Описание:"
											Foreground="Gray"
											FontSize="10"
                                            Margin="5"
											HorizontalAlignment="Center"/>
                            	<TextBlock Text="{Binding Path=Description}"
                                           HorizontalAlignment="Left"
                                           MaxWidth="300"
                                           TextWrapping="Wrap"
                                           FontSize="12"
                                           FontWeight="Normal"
                                           Margin="5,0,5,5"/>
                             </StackPanel>
                        </Border>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</Window>
